<template>
	<view>
		<unicloud-db ref="db" v-slot:default="{data, loading, error, options}" collection="notice">
			<view v-if="error">{{error.message}}</view>
			<view v-else>
				<view v-for="(item,index) in data" :key="index">
					<uni-card :title="item.title">
						<text class="notice-card">{{item.content}}</text>
					</uni-card>
				</view>
			</view>
		</unicloud-db>

	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		onShow() {
			this.$refs.db.refresh()
		},
		methods: {

		}
	}
</script>

<style>
	.notice-card {
		word-wrap: break-word;
		width: 100%;
		height: 100%;
	}
</style>